import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image } from '@tarojs/components'
import PropTypes from 'prop-types'
import './search_view.scss'
import searchIcon from './static/icon_search.png'
/**
 * 搜索显示组件
 * @author huangkh
 */
class SearchView extends Component {

    render(){
        const { placeholder,onSearchView } = this.props
        return(
            <View className='search_container'>
                <View className='search_content' onClick={onSearchView()}>
                    <Image className='search_icon' src={searchIcon}></Image>
                    <Text>{ placeholder }</Text>
                </View>
            </View>
        )
    }
}

SearchView.propTypes = {
    placeholder : PropTypes.string,
    onSearchView : PropTypes.func.isRequired
}

SearchView.defaultProps = {
    placeholder : '大家都在搜：',
    onSearchView : ()=>{}
}


export default SearchView